package com.wise.transactionsyn.sample1;

import java.io.Serializable;

/**
 * 模拟一个Session类
 */
public class MySession {
    private long sessionId;

    public void save(Serializable entity) {
        System.out.println(sessionId + ":save");
    }

    public void beginTransaction() {
        System.out.println(sessionId + ":beginTransaction");
    }

    public void commit() {
        System.out.println(sessionId + ":commit");
    }

    public void rollback() {
        System.out.println(sessionId + ":rollback");
    }

    public long getSessionId() {
        return sessionId;
    }

    public void setSessionId(long sessionId) {
        this.sessionId = sessionId;
    }

    @Override
    public String toString() {
        return "MySession{" +
                "sessionId=" + sessionId +
                '}';
    }
}
